package com.study.lihan.threalLocal;

import com.study.lihan.bean.Student;

import java.lang.ref.WeakReference;

/**
 * @Author: lihan
 * @Date : 2022/1/2- 01
 * @DESCRIPTION: com.study.lihan.threalLocal
 * @version: 1.0
 */
public class TestWeakReference {
    public static void main(String[] args) {
        WeakReference<Student> weakReference = new WeakReference<Student>(new Student());
        System.out.println(weakReference.get());
        System.gc();
        System.out.println(weakReference.get());

       /* ThreadLocal<Student> tl = new ThreadLocal<>();
        tl.set(new Student());
        tl.remove();
*/
    }
}
